<template>
  <div class="project-file-container">
    <template v-for="(item, index) in projectFileList" :key="index">
      <div class="project-file-item" @click="projectFileStore.clickProjectFile(item)">
        <div class="icon"><svg-icon :name="item.icon" size="1.2em"></svg-icon></div>
        <span>{{ item.name }}</span>
      </div>
    </template>
  </div>
</template>

<script setup lang="ts">
import { useProjectFileStore } from '@renderer/store/resourceBar/projectFile'
import { storeToRefs } from 'pinia'

const projectFileStore = useProjectFileStore()
const { projectFileList } = storeToRefs(projectFileStore)
</script>

<style scoped lang="scss">
.project-file-container {
  width: 100%;
  height: 100%;
  padding-top: 5px;
  padding-left: 5px;
  font-size: 13px;
  .project-file-item {
    display: flex;
    justify-content: left;
    align-items: center;
    gap: 5px;
    height: 30px;
    background-color: #f9fdff;
    cursor: pointer;
    margin-bottom: 5px;
    &:hover {
      background-color: #f5f5f5;
    }

    .icon {
      width: 20px;
    }
  }
}
</style>
